@use "info-layer";

.weather-wrapper {
  width: 100%;
  background-color: var(--bg-grey);
  color: var(--text-color);
}

@media (min-width: 756px) {
  .weather-wrapper {
    display: flex;
    align-items: stretch;
  }

  .wide-left {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    width: 40vw;
  }

  .wide-right {
    flex: 1;
    overflow-y: auto;
    max-height: 100vh;
  }
}

/* 天气基本信息 */
.info-wrapper {
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  width: 100%;
  height: 360px;
  padding-bottom: 60px;

  background-image: linear-gradient(-90deg, #3bbcff, #4af4ff);
  color: #fff;

  text-align: center;

  @media (min-width: 756px) {
    flex: 1;
  }
}

.quality {
  position: absolute;
  left: 8px;
  z-index: 10;

  padding: 8px 12px;
  border-radius: 8px;

  background-color: #ffbf62;
  box-shadow: 0 1px 1px 0 rgb(0 0 0 / 12%);

  &.level1 {
    background-color: #a3d765;
  }

  &.level2 {
    background-color: #f0cc35;
  }

  &.level3 {
    background-color: #f1ab62;
  }

  &.level4 {
    background-color: #ef7f77;
  }

  &.level5 {
    background-color: #b28ccb;
  }

  &.level6 {
    background-color: #ad788a;
  }
}

.quality-number {
  height: 12px;
  margin-bottom: 3px;

  color: #fff;

  font-size: 12px;
  line-height: 12px;

  opacity: 0.8;
}

.quality-level {
  height: 14px;
  margin-top: 2px;

  color: #fff;

  font-size: 12px;
  line-height: 14px;
}

.share-button {
  position: absolute;
  right: 8px;
  z-index: 10;

  width: auto !important;
  padding: 6px 12px !important;
  border: none !important;
  border-radius: 16px;

  background-color: #ffa500 !important;
  color: #fff !important;

  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
}

.location-wrapper {
  width: 76%;
  margin: 8px 12%;
  font-size: 16px;
  line-height: 1.5;
}

.current-info {
  position: relative;
  z-index: 10;
}

.current-temperature {
  padding-left: 0.5em;
  font-size: 62px;
  line-height: 1.2;
}

.current-type {
  font-size: 22px;
  line-height: 2;
}

.current-detail {
  font-size: 15px;
  line-height: 2;
}

.tip {
  margin: 8px;
  font-size: 16px;
  line-height: 1.5;
}

.alarm {
  max-width: 80px;
  margin: 8px auto;
  padding: 4px 8px;
  border-radius: 8px;

  background-color: rgb(127 127 127 / 25%);

  font-size: 14px;
  line-height: 1.25;

  &.yellow {
    background-color: #ffbf62;
  }

  &.red {
    background-color: #ff6033;
  }

  &.blue {
    background-color: #3bbcff;
  }
}

/* 今明天预报 */
.forecast {
  position: relative;

  display: flex;

  margin-bottom: 10px;
  padding: 8px 0;

  background-color: var(--bg-block);

  .item {
    flex: 1;

    padding: 0 20px;

    color: var(--grey4);

    font-size: 14px;
    line-height: 14px;
  }

  .day-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0;
  }

  .weather {
    line-height: 22px;
  }

  .icon {
    width: 22px;
    height: 22px;
  }
}

/* 小时预报 */
.hours {
  display: flex;
  align-items: stretch;

  height: 110px;
  margin: 20px 0;

  background-color: var(--bg-block);

  .item {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;

    width: 58px;
    padding: 10px 0;

    text-align: center;
  }

  .time {
    color: var(--light-grey);
    font-size: 12px;
    line-height: 1.2;
  }

  .icon {
    width: 24px;
    height: 24px;
  }

  .degree {
    color: var(--grey4);
    font-size: 14px;
    line-height: 1.2;
  }
}

/* 天预报 */
.days {
  position: relative;

  display: flex;

  width: 100%;
  height: 400px;

  background-color: var(--bg-block);

  text-align: center;

  .item {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;

    width: 20%;
    padding: 20px 0;
  }

  .day {
    color: var(--light-grey);
    font-size: 12px;
    line-height: 1.2;
  }

  .date {
    color: var(--light-grey);
    font-size: 12px;
    line-height: 1.2;
  }

  .weather {
    color: var(--grey4);
    font-size: 14px;
    line-height: 1.5;
  }

  .icon {
    width: 24px;
    height: 24px;
    margin: 8px auto;
  }

  .placeholder {
    height: 148px;
  }

  .wind {
    color: #b2b2b2;
    font-size: 12px;
    line-height: 1;

    @media (prefers-color-scheme: dark) {
      color: #434343;
    }
  }
}

/* 画布 */
.temperature-canvas {
  position: absolute;
  top: 144px;
  width: 160%;
  height: 148px;
}

/* 其他信息 */
.hints {
  display: flex;
  flex-wrap: wrap;
  margin: 20px 0;
  background-color: var(--bg-block);

  .item {
    position: relative;
    width: 25%;
    height: 94px;
    text-align: center;

    &::before {
      content: " ";

      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;

      width: 1px;
      border-right: 1px solid var(--border-color);

      transform: scaleX(0.4);
      transform-origin: 100% 0;
    }

    &::after {
      content: " ";

      position: absolute;
      right: 0;
      bottom: 0;
      left: 0;

      height: 1px;
      border-bottom: 1px solid var(--border-color);

      transform: scaleY(0.4);
      transform-origin: 0 100%;
    }

    &:nth-child(4n)::before {
      border-right-width: 0;
    }

    &:nth-child(n + 21)::after {
      border-bottom-width: 0;
    }

    .icon {
      display: block;

      width: 24px;
      height: 24px;
      margin: 16px auto 10px;

      background-size: 24px;
    }
  }

  .content {
    height: 14px;
    margin-bottom: 6px;

    color: var(--grey4);

    font-size: 14px;
    line-height: 14px;
  }

  .title {
    height: 12px;
    color: var(--light-grey);
    font-size: 10px;
    line-height: 12px;
  }
}

.footer {
  color: var(--grey);
  font-size: 12px;
  text-align: center;
}
